473,470 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Default Select List

During registration, users have to provide their date of birth. For
the date & month part, there are 2 dropdown lists & for the year,
there's a textbox. These 3 fields are finally merged together to
populate a MS-Access database table in a column named DOB whose data
type is Date/Time.

There's another page named, say, MyPage.asp, in the same application
where users have to again enter their date of birth. Like the
registration page, here too there are 2 dropdown lists for the date &
month part & a textbox for the year part.

Assuming that a user has already registered, when he comes MyPage.asp
(which again has the date of birth fields), I don't want to make the
user enter the same info again. Rather I would retrieve his date of
birth from the DB table & populate the 2 dropdown lists with the date
& month & populate the textbox with the year.

Assume that the user's date of birth is 22/10/1980 (dd/mm/yyyy
format). Populating the year 1980 in the textbox is not a problem. The
problem is how do I ensure that when this user comes to MyPage.asp,
the date dropdown list selects 22 by default & the month dropdown list
selects October by default.

With what do I compare the date & month values that have been
retrieved from the DB table so that the 2 dropdown lists select the
correct option by default?

Note that in the DB table, dates are in the same format as shown above
but in the ASP page, the month dropdown list is populated with
January, February, March, April, May etc. & not 1, 2, 3, 4, 5 etc.

May 6 '07 #1
2 3311
On May 6, 6:31 am, r...@rediffmail.com wrote:
During registration, users have to provide their date of birth. For
the date & month part, there are 2 dropdown lists & for the year,
there's a textbox. These 3 fields are finally merged together to
populate a MS-Access database table in a column named DOB whose data
type is Date/Time.

There's another page named, say, MyPage.asp, in the same application
where users have to again enter their date of birth. Like the
registration page, here too there are 2 dropdown lists for the date &
month part & a textbox for the year part.

Assuming that a user has already registered, when he comes MyPage.asp
(which again has the date of birth fields), I don't want to make the
user enter the same info again. Rather I would retrieve his date of
birth from the DB table & populate the 2 dropdown lists with the date
& month & populate the textbox with the year.

Assume that the user's date of birth is 22/10/1980 (dd/mm/yyyy
format). Populating the year 1980 in the textbox is not a problem. The
problem is how do I ensure that when this user comes to MyPage.asp,
the date dropdown list selects 22 by default & the month dropdown list
selects October by default.

With what do I compare the date & month values that have been
retrieved from the DB table so that the 2 dropdown lists select the
correct option by default?

Note that in the DB table, dates are in the same format as shown above
but in the ASP page, the month dropdown list is populated with
January, February, March, April, May etc. & not 1, 2, 3, 4, 5 etc.
OK....I got it.....

May 6 '07 #2
This is more a client side problem.

But I will show you how.

First I assume you can write your values to the client side script something
like

var dDay = '<%=dDay%>'

assuming you know how to do this you then see how I have done this example
http://dev.thatsit.net.au/Samples/dh...t/dropdown.asp

<rn**@rediffmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
During registration, users have to provide their date of birth. For
the date & month part, there are 2 dropdown lists & for the year,
there's a textbox. These 3 fields are finally merged together to
populate a MS-Access database table in a column named DOB whose data
type is Date/Time.

There's another page named, say, MyPage.asp, in the same application
where users have to again enter their date of birth. Like the
registration page, here too there are 2 dropdown lists for the date &
month part & a textbox for the year part.

Assuming that a user has already registered, when he comes MyPage.asp
(which again has the date of birth fields), I don't want to make the
user enter the same info again. Rather I would retrieve his date of
birth from the DB table & populate the 2 dropdown lists with the date
& month & populate the textbox with the year.

Assume that the user's date of birth is 22/10/1980 (dd/mm/yyyy
format). Populating the year 1980 in the textbox is not a problem. The
problem is how do I ensure that when this user comes to MyPage.asp,
the date dropdown list selects 22 by default & the month dropdown list
selects October by default.

With what do I compare the date & month values that have been
retrieved from the DB table so that the 2 dropdown lists select the
correct option by default?

Note that in the DB table, dates are in the same format as shown above
but in the ASP page, the month dropdown list is populated with
January, February, March, April, May etc. & not 1, 2, 3, 4, 5 etc.
May 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: deko | last post by:
I populate a drop-down list like this: echo "<select>"; foreach ( $ip_list as $var ) { echo "<option>"; echo $var; echo "</option>"; } echo "</select>";
2
by: iam247 | last post by:
Hi I have an ASP form which only includes an option list. The list is dynamically created but includes a default value, which is an instruction "Select a group". The code is shown at bottom....
1
by: Peter Bailey | last post by:
Thanks to the news group I can now clear a list box. The default value in properties of the combo is set to "please select a year". the code Me.CBDOSYear = Me.CBDOSYear.ItemData(0) however...
1
by: Null | last post by:
Hello -- Is there a way to prevent the autopostback of a drop down list if there is a "default" item in the list -- example, a drop down list where the first item says "Select One" and the...
5
by: Kris Rockwell | last post by:
Hello (again), I have gotten the dropdown list functionality to work through a few tricks (probably not the most efficient, but it works) but I am not sure how to set the default selected value....
2
by: rodchar | last post by:
Hey all, I have an asp.net page called default.aspx. when I visit this site i type in http://myDirectory/ because I know that the name default.aspx will be assumed. However, when i goto this...
0
by: Ryan Liu | last post by:
In a listview, I found it is pretty nice I can type a letter or more letter quickly to select the NEXT item which begin with that letter(s). But seems the first row, even not high lighted, always...
3
by: Ming | last post by:
I have two list box (A and B), and I have two buttons to move list items (options) from this box to the other.I have a submit button to submit the form. I know how to move items from A to B by...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.